Skip to content

Conversation

rggdmonk
Copy link
Contributor

@rggdmonk rggdmonk commented Oct 18, 2025

Summary

font_download                        # new module
├── __init__.py
├── README.md                        # how to use
├── reproducible_font_download.py    # main logic
├── reproducible_fonts               # store default downloadble fonts
│   ├── honk.py
│   └── noto_sans.py
├── test_font_download               # tests
│   ├── conftest.py
│   ├── test_font_download.py
│   ├── test_integration.py
│   └── test_tools.py
└── tools.py

It's updated version for sign/WeLT#26

  1. Add interface
    • Download fonts from config or pattern
    • Create config for font downloads
  2. Tests
  3. Demos
demos
├── font_download
│   └── demo_create_font_download_configs.py
├── pixel_renderer
│   └── demo_render_text_image.py
└── README.md

Breaking change

  • remove dpi parameter

@rggdmonk rggdmonk marked this pull request as ready for review October 20, 2025 13:08
"pixel_renderer",
"font_configurator",
]
testpaths = ["tests", "pixel_renderer", "font_configurator", "font_download"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate line for each

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why, but VSCode won't let me do this...

downloader = ReproducibleFontDownload()

# save config
config_path = downloader.save_config(sources=list_font_sources, config_name="my_fonts")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the sources mentioned here and not at the object instantiation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be:

downloader = ReproducibleFontDownloader(sources=list_font_sources)

# save config
config_path = downloader.save_config(config_name="my_fonts")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesterday I updated README.md - https://github.com/sign/pixel-renderer/blob/ebcb90af7938a702ef56a983c1cda677cc39827c/font_download/README.md

I chose this design to treat the class as a stateless font cache manager. By passing sources directly to methods, a single instance can be reused to save one config, load another, and list all available configs. Tying the instance to a specific source list in the constructor would limit this flexibility and make methods like from_config less intuitive.

downloader = ReproducibleFontDownload()

# save config
config_path = downloader.save_config(sources=list_font_sources, config_name="my_fonts")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be:

downloader = ReproducibleFontDownloader(sources=list_font_sources)

# save config
config_path = downloader.save_config(config_name="my_fonts")

@AmitMY AmitMY merged commit c7ffff3 into sign:main Oct 21, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants